<!DOCTYPE html >
<html>
<head>
    <link rel="stylesheet" href="demos.css" type="text/css" media="screen" />
    
    <script src="../libraries/RGraph.common.core.js" ></script>
    <script src="../libraries/RGraph.common.tooltips.js" ></script>
    <script src="../libraries/RGraph.common.dynamic.js" ></script>
    <script src="../libraries/RGraph.pie.js" ></script>
    <!--[if lt IE 9]><script src="../excanvas/excanvas.js"></script><![endif]-->
    
    <title>A customised Pie chart</title>
    
    <meta name="description" content="A customised Pie chart" />
     
</head>
<body>

    <h1>A customised Pie chart</h1>

    <canvas id="cvs" width="480" height="250" !style="border:1px solid #ccc">[No canvas support]</canvas>
    
    <script>
        window.onload = function ()
        {
            var data = [20,13.43,2.83,4.24,7.42,13.43,38.65];

            var pie = new RGraph.Pie('cvs', data)
                .Set('labels', ['Miscellaneous','Cooking','Office equipment','Refridgeration','Cooling','Ventilation','Lighting'])
                .Set('tooltips', ['Miscellaneous','Cooking','Office equipment','Refridgeration','Cooling','Ventilation','Lighting'])
                .Set('tooltips.event', 'onmousemove')
                .Set('colors', ['#EC0033','#A0D300','#FFCD00','#00B869','#999999','#FF7300','#004CB0'])
                .Set('strokestyle', 'white')
                .Set('linewidth', 3)
                .Set('shadow', true)
                .Set('shadow.offsetx', 2)
                .Set('shadow.offsety', 2)
                .Set('shadow.blur', 3)
                .Set('exploded', 7)
            
            for (var i=0; i<data.length; ++i) {
                pie.Get('labels')[i] = pie.Get('labels')[i] + ', ' + data[i] + '%';
            }
            
            pie.Draw();
        }
    </script>

    <p>        
        <a href="./">&laquo; Back</a>
    </p>

</body>
</html>